package cn.dgut.training.vo.pageVO;

import cn.dgut.training.vo.BaseVO;

import java.util.List;

public class PageVO extends BaseVO {


    public  PageVO(String type,List list){


        if(type.equals("region")){
            this.setTotal(list.size());
            this.setPages(1);
            this.setSize(list.size());
            this.setCurrent(1);
            this.setList(list);

        }
        else {
            this.setTotal(list.size());
            this.setPages((int) Math.ceil((float) list.size() / 20.0));
            this.setSize(20);
            this.setCurrent(1);
            this.setList(list);
        }
    }
}
